<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.io.StringParser.parseExperience</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d3/dca/classnars_1_1io_1_1StringParser_a37ff864d959aba58138170a3f9a3e7c8.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="a37ff864d959aba58138170a3f9a3e7c8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/ddc/classnars_1_1entity_1_1Task.html">Task</a> nars.io.StringParser.parseExperience </td>
          <td>(</td>
          <td class="paramtype">StringBuffer&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>&#160;</td>
          <td class="paramname"><em>memory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Parse a line of input experience. </p>
<p>called from ExperienceIO.loadLine </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>The line to be parsed </td></tr>
    <tr><td class="paramname">memory</td><td>Reference to the memory </td></tr>
    <tr><td class="paramname">time</td><td>The current time </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An experienced task </dd></dl>

<p>Definition at line <a class="el" href="../../d7/dcd/StringParser_8java_source.html#l00061">61</a> of file <a class="el" href="../../d7/dcd/StringParser_8java_source.html">StringParser.java</a>.</p>

<p>References <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00080">nars.io.Symbols.INPUT_LINE</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00081">nars.io.Symbols.OUTPUT_LINE</a>, <a class="el" href="../../d7/dcd/StringParser_8java_source.html#l00086">nars.io.StringParser.parseTask()</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00082">nars.io.Symbols.PREFIX_MARK</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00088">nars.io.Symbols.STAMP_CLOSER</a>, and <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00087">nars.io.Symbols.STAMP_OPENER</a>.</p>

<p>Referenced by <a class="el" href="../../db/d0c/Memory_8java_source.html#l01000">nars.storage.Memory.ReasonerBatch.textInputLine()</a>.</p>
<div class="fragment"><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                                                                                      {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordtype">int</span> i = buffer.indexOf(<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a52a0cc8bcdfeb683433fb4dfdd167554.html#a52a0cc8bcdfeb683433fb4dfdd167554">PREFIX_MARK</a> + <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <span class="keywordflow">if</span> (i &gt; 0) {</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;            String prefix = buffer.substring(0, i).trim();</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;            <span class="keywordflow">if</span> (prefix.equals(<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_aa8d204dd29cc8dd9793f8dfe7c4ff979.html#aa8d204dd29cc8dd9793f8dfe7c4ff979">OUTPUT_LINE</a>)) {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (prefix.equals(<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a75b6ca172df6ae3f0d06cf70d3d2ec1c.html#a75b6ca172df6ae3f0d06cf70d3d2ec1c">INPUT_LINE</a>)) {</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                buffer.delete(0, i + 1);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            }</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        }</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keywordtype">char</span> c = buffer.charAt(buffer.length() - 1);</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <span class="keywordflow">if</span> (c == <a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a773509e7bc6cbf7b365c90fc2e48dc6b.html#a773509e7bc6cbf7b365c90fc2e48dc6b">STAMP_CLOSER</a>) {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordtype">int</span> j = buffer.lastIndexOf(<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a8543cf41a20f45b3e2ece8b7969ed15b.html#a8543cf41a20f45b3e2ece8b7969ed15b">STAMP_OPENER</a> + <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            buffer.delete(j - 1, buffer.length());</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        }</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="../../d3/dca/classnars_1_1io_1_1StringParser_a75b446999d71c676a9915ecc75077a7d.html#a75b446999d71c676a9915ecc75077a7d">parseTask</a>(buffer.toString().trim(), memory, time);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a52a0cc8bcdfeb683433fb4dfdd167554_html_a52a0cc8bcdfeb683433fb4dfdd167554"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a52a0cc8bcdfeb683433fb4dfdd167554.html#a52a0cc8bcdfeb683433fb4dfdd167554">nars.io.Symbols.PREFIX_MARK</a></div><div class="ttdeci">static final char PREFIX_MARK</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00082">Symbols.java:82</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a773509e7bc6cbf7b365c90fc2e48dc6b_html_a773509e7bc6cbf7b365c90fc2e48dc6b"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a773509e7bc6cbf7b365c90fc2e48dc6b.html#a773509e7bc6cbf7b365c90fc2e48dc6b">nars.io.Symbols.STAMP_CLOSER</a></div><div class="ttdeci">static final char STAMP_CLOSER</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00088">Symbols.java:88</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a8543cf41a20f45b3e2ece8b7969ed15b_html_a8543cf41a20f45b3e2ece8b7969ed15b"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a8543cf41a20f45b3e2ece8b7969ed15b.html#a8543cf41a20f45b3e2ece8b7969ed15b">nars.io.Symbols.STAMP_OPENER</a></div><div class="ttdeci">static final char STAMP_OPENER</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00087">Symbols.java:87</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a75b6ca172df6ae3f0d06cf70d3d2ec1c_html_a75b6ca172df6ae3f0d06cf70d3d2ec1c"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a75b6ca172df6ae3f0d06cf70d3d2ec1c.html#a75b6ca172df6ae3f0d06cf70d3d2ec1c">nars.io.Symbols.INPUT_LINE</a></div><div class="ttdeci">static final String INPUT_LINE</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00080">Symbols.java:80</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_aa8d204dd29cc8dd9793f8dfe7c4ff979_html_aa8d204dd29cc8dd9793f8dfe7c4ff979"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_aa8d204dd29cc8dd9793f8dfe7c4ff979.html#aa8d204dd29cc8dd9793f8dfe7c4ff979">nars.io.Symbols.OUTPUT_LINE</a></div><div class="ttdeci">static final String OUTPUT_LINE</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00081">Symbols.java:81</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1StringParser_a75b446999d71c676a9915ecc75077a7d_html_a75b446999d71c676a9915ecc75077a7d"><div class="ttname"><a href="../../d3/dca/classnars_1_1io_1_1StringParser_a75b446999d71c676a9915ecc75077a7d.html#a75b446999d71c676a9915ecc75077a7d">nars.io.StringParser.parseTask</a></div><div class="ttdeci">static Task parseTask(String s, Memory memory, long time)</div><div class="ttdoc">Enter a new Task in String into the memory, called from InputWindow or locally. </div><div class="ttdef"><b>Definition:</b> <a href="../../d7/dcd/StringParser_8java_source.html#l00086">StringParser.java:86</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d3/dca/classnars_1_1io_1_1StringParser_a37ff864d959aba58138170a3f9a3e7c8_a37ff864d959aba58138170a3f9a3e7c8_cgraph.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

<p><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/dca/classnars_1_1io_1_1StringParser_a37ff864d959aba58138170a3f9a3e7c8_a37ff864d959aba58138170a3f9a3e7c8_icgraph.svg" width="438" height="52"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../db/d64/namespacenars_1_1io.html">io</a></li><li class="navelem"><a class="el" href="../../d3/dca/classnars_1_1io_1_1StringParser.html">StringParser</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
